package at.horario.model;


import at.horario.model.GenericObject;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.io.Serializable;

@Entity
public class Tooltip extends GenericObject<String> implements Serializable {
    private String id;
    private String descricao;


    public Tooltip() {
    }


    public Tooltip(String id) {
        this.id = id;
    }

    public Tooltip(String id, String descricao) {
        this.id = id;
        this.descricao = descricao;
    }

    @Id
    @Column(name = "id", length = 40)
    public String getId() {
        return id;
    }

    @Column(name = "descricao", length = 100)
    public String getDescricao() {
        return descricao;
    }


    public void setId(String id) {
        this.id = id;
    }

    public void setDescricao(String descricao) {
        this.descricao = descricao;
    }


    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Tooltip tooltip = (Tooltip) o;

        if (!id.equals(tooltip.id)) return false;
        if (descricao != null ? !descricao.equals(tooltip.descricao) : tooltip.descricao != null) return false;

        return true;
    }

    public int hashCode() {
        int result;
        result = id.hashCode();
        result = 31 * result + (descricao != null ? descricao.hashCode() : 0);
        return result;
    }


    public String toString() {
        return "Tooltip{" +
                "id='" + id + '\'' +
                ", descricao='" + descricao + '\'' +
                '}';
    }
}
